package com.hwhhhh.graduationproject.service;

import com.hwhhhh.graduationproject.controller.param.UserReq;
import com.hwhhhh.graduationproject.domain.model.User;
import com.hwhhhh.graduationproject.exception.InvalidAccountException;
import org.springframework.stereotype.Service;

/**
 * @Description detail
 * Created by Hwhhhh on 2021/3/2 12:07
 */

public interface UserService {
    /**
     * 用户登录
     * @param account 账号，邮箱或者手机
     * @param pwd 密码
     * @return
     */
    User login(UserReq userReq) throws Exception;

    /**
     * 按邮箱检查是否已存在此用户，若存在返回true，不存在返回false
     * @param email
     * @return
     */
    boolean checkEmail(String email);

    /**
     * 用户注册
     * @param userReq
     * @return 返回token
     */
    String register(UserReq userReq);

    void updateUserInfo(UserReq userReq, int userId) throws Exception;

    void uploadProfilePhoto(int userId, String url) throws Exception;
}
